﻿Imports Microsoft.Practices.Composite.Modularity
Imports Microsoft.Practices.Unity
Imports Microsoft.Practices.Composite.Regions
Imports Hinshelwood.TFSStickyBuddy.Infrastructure
Imports Hinshelwood.TFSStickyBuddy.Modules.Interfaces
Imports Hinshelwood.TFSStickyBuddy.Modules.Controllers

'Imports StockTraderRI.Infrastructure.Interfaces
'Imports StockTraderRI.Modules.News.Article
'Imports StockTraderRI.Modules.News.Controllers
'Imports StockTraderRI.Modules.News.Services

Public Class KanbanModule
    Implements IModule

    Private ReadOnly m_container As IUnityContainer
    Private ReadOnly m_regionManager As IRegionManager
    Private ReadOnly m_NavigationService As INavigationService

    Public Sub New(ByVal container As IUnityContainer, ByVal regionManager As IRegionManager, ByVal NavigationService As INavigationService)
        m_container = container
        m_regionManager = regionManager
        m_NavigationService = NavigationService
    End Sub


    Public Sub Initialize() Implements Microsoft.Practices.Composite.Modularity.IModule.Initialize
        RegisterViewsAndServices()
        ' Setup Menus and Nav
        Dim controller As IKanbanController = m_container.Resolve(Of IKanbanController)()
        'InfragisticsHelper.MergeRibbon(m_regionManager, New FeedbackRibbonTemplate)
        m_NavigationService.AddButtonTool("Kanban By Status", controller.ByStatusCommand, Nothing, RegionNames.Shell_Ribbon_HomeTab_DashboardsGroup)
        m_NavigationService.AddButtonTool("Kanban By Custom", controller.ByCustomCommand, Nothing, RegionNames.Shell_Ribbon_HomeTab_DashboardsGroup)
    End Sub

    Protected Sub RegisterViewsAndServices()
        m_container.RegisterType(Of IKanbanController, KanbanController)(New ContainerControlledLifetimeManager())

    End Sub




End Class
